// import config from '../../config/index';
import axiosInstance from '@/utils/request'
import { IPageListParams, IPageListRow } from '@/types/article'
import { IApiResult, IPageListResult } from '@/types'
const config = require('@/config/index')

const api = {
  getPageList: (params: IPageListParams) => {
    return axiosInstance<IApiResult<IPageListResult<IPageListRow>>>({
        url: config.API_URL_PREFIX + '/mp/articles',
        method: 'get',
        params
    })
  },
  delete: (id: string) => {
    return axiosInstance({
        url: config.API_URL_PREFIX + '/mp/articles/' + id,
        method: 'delete'
    })
  },
  add: (data: any) => {
    return axiosInstance({
        url: config.API_URL_PREFIX + '/mp/articles',
        method: 'post',
        data
    })
  },
}

export default api
